// xuanzhe.cpp : implementation file
//

#include "stdafx.h"
#include "d.h"
#include "xuanzhe.h"
#include "xiaosou.h"
#include "rukudengji.h"

#include "laoban.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Cxuanzhe dialog


Cxuanzhe::Cxuanzhe(CWnd* pParent /*=NULL*/)
	: CDialog(Cxuanzhe::IDD, pParent)
{
	//{{AFX_DATA_INIT(Cxuanzhe)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void Cxuanzhe::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Cxuanzhe)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Cxuanzhe, CDialog)
	//{{AFX_MSG_MAP(Cxuanzhe)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_WM_CTLCOLOR()
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cxuanzhe message handlers

void Cxuanzhe::OnButton2() 
{
	// TODO: Add your control notification handler code here
	OnOK();
	Cxiaosou dlg;
	this->ShowWindow(SW_HIDE);
	dlg.DoModal();
	this->ShowWindow(SW_SHOW);
}

void Cxuanzhe::OnButton1() 
{
	// TODO: Add your control notification handler code here
	OnOK();
	Crukudengji dlg;
	this->ShowWindow(SW_HIDE);
	dlg.DoModal();
	this->ShowWindow(SW_SHOW);
}

void Cxuanzhe::OnButton3() 
{
	// TODO: Add your control notification handler code here
	OnOK();
	Claoban dlg;
	this->ShowWindow(SW_HIDE);
	dlg.DoModal();
	this->ShowWindow(SW_SHOW);


}
int dd=0;
BOOL Cxuanzhe::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CBitmap bmp; 
bmp.LoadBitmap(IDB_BITMAP5); 
m_brBk.CreatePatternBrush(&bmp); 
bmp.DeleteObject(); 

CBitmap Bitmap3;
Bitmap3.LoadBitmap(IDB_BITMAP8);
HBITMAP hBitmap=(HBITMAP)Bitmap3.Detach();
CButton *pButton=(CButton*)GetDlgItem(IDC_BUTTON1);
pButton->SetBitmap(hBitmap);


	// TODO: Add extra initialization here
CBitmap Bitmap1;
Bitmap1.LoadBitmap(IDB_BITMAP6);
HBITMAP hBitmap1=(HBITMAP)Bitmap1.Detach();
CButton *pButton1=(CButton*)GetDlgItem(IDC_BUTTON3);
pButton1->SetBitmap(hBitmap1);


CBitmap Bitmap7;
Bitmap7.LoadBitmap(IDB_BITMAP7);
HBITMAP hBitmap7=(HBITMAP)Bitmap7.Detach();
CButton *pButton7=(CButton*)GetDlgItem(IDC_BUTTON2);
pButton7->SetBitmap(hBitmap7);



if(xuanzhe16==3)//yuangong
	{		
	GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);
	GetDlgItem(IDC_BUTTON3)->ShowWindow(SW_HIDE);
	}
else if(xuanzhe16==2)//ruku
{
	GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_HIDE);
	GetDlgItem(IDC_BUTTON3)->ShowWindow(SW_HIDE);
}
else if(xuanzhe16==1)//laoban
{
	GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);
	GetDlgItem(IDC_BUTTON2)->ShowWindow(SW_HIDE);
}


	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

HBRUSH Cxuanzhe::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	if (pWnd == this) 
{ 
return m_brBk; 
} 
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

void Cxuanzhe::OnPaint() 
{
}

HCURSOR Cxuanzhe::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}
